<?php

namespace backend\controllers;

use Yii;
use common\models\Logs;
use backend\models\LogsSearch;
use backend\components\CRUDController;
use yii\web\NotFoundHttpException;

/**
 * LogsController implements the CRUD actions for Logs model.
 */
class LogsController extends CRUDController
{

  /**
   * @param null $id
   * @param bool $search
   * @return LogsSearch|Logs|static
   * @throws NotFoundHttpException
   */
  protected  function findModel($id = null,$search = false)
  {
    if($search){
        $model = new LogsSearch();
    }else if(empty($id)){
        $model = new Logs();
    }else{
        if (($model = Logs::findOne($id)) == null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
    return $model;
  }


}
